<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
	import="java.util.*"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="static/jquery/jquery-2.2.4.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="static/bootstrap/css/3.3.6/bootstrap.min.css">
<link rel="stylesheet" href="static/H+/css/style.min.css">
<script src="static/bootstrap/js/3.3.6/bootstrap.min.js"
	type="text/javascript"></script>
</head>
<style>
body {
	background-image:url(./static/img/background.jpg) ;
}
#listTable{
margin-top:100px;
width:1250px;
font-family: 微软雅黑;
}
#searchCarForm{
margin-top:20px;
}
a:hover{
color: #C40000; 
}
</style>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<body>
<div class="nav" style="background-color:#663366;">
	<ul class="nav nav-pills" >
		<li><a href="index.jsp">Index</a></li>
		<li><a href="./showDetail">用户资料</a></li>
		<li><a href="./listCar">全部汽车</a></li>
		<li><a href="addCar.jsp">添加汽车</a></li>
		<li class="active"><a href="searchCar.jsp">搜索汽车</a></li>
		<li><a href="searchUser.jsp">搜索用户</a></li>
		<li><a href="about.jsp">关于本站</a></li>
	</ul>
	</div>
<form action="searchCar" method="post" id="searchCarForm">
	<div class="col-lg-6">
		<div class="input-group">

			<input type="text" name="searchValue" class="form-control"
				placeholder="请输入用户名或汽车编号"> <span class="input-group-btn">

				<button type="submit" class="btn btn-success" form="searchCarForm"
					value="Submit">搜索</button>
			</span>
		</div>
	</div>
</form>

<table id="listTable" class="table table-hover" align='center' border='1' cellspacing='0' style="border-radius:5px;overflow:hidden;">
	<thead>
		<tr>
			<td>汽车编号</td>
			<td>车主姓名</td>
			<td>车名</td>
			<td>车型</td>
			<td>颜色</td>
			<td>牌照</td>
			<td>编辑</td>
			<td>删除</td>
		</tr>
	</thead>
	<tbody>

		<c:forEach items="${cars}" var="car" varStatus="st">
			<tr>
				<td>${car.getCarId()}</td>
				<td>${car.getUserName()}</td>
				<td>${car.getCarName()}</td>
				<td>${car.getCarType()}</td>
				<td>${car.getCarColor()}</td>
				<td>${car.getCarCard()}</td>
				<td><a href="editCar?carid=${car.getCarId()}">点此修改</a></td>
				<td><a href="deleteCar?carid=${car.getCarId()}">点此删除</a></td>
			</tr>
		</c:forEach>

	</tbody>
</table>
</body>
<script>
$(document).ready(function(){
	SetTableRowColor();
	
})
function SetTableRowColor(){
	$("#listTable tr:odd").css("background-color", " #99cc99");
    $("#listTable tr:even").css("background-color", "rgb(197,224,180)");
}
</script>